﻿<!--
    © 2012 Alex Kazaev
    FolderDrive project [http://folderdrive.codeplex.com/]
    Licensed under Ms-PL license [http://www.opensource.org/licenses/MS-PL]
    -->
<UserControl x:Class="FolderDrive.Controls.MappingGridControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Background="AliceBlue" Orientation="Horizontal">
            <CheckBox Margin="4 0 0 0" Width="100" IsChecked="{Binding AllChecked}">(Un)Check all</CheckBox>
            <TextBlock ToolTip="Indicates permanent mapping">[<Hyperlink>P</Hyperlink>]</TextBlock>
            <TextBlock Width="100">Drive Letter</TextBlock>
            <TextBlock>Mapped Path</TextBlock>
        </StackPanel>
        <ListBox Grid.Row="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ItemsSource="{Binding MappingItems}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <CheckBox Width="100" IsChecked="{Binding Selected}"/>
                        <CheckBox IsEnabled="False" IsChecked="{Binding IsPermanent}"></CheckBox>
                        <TextBlock Width="100" Text="{Binding DriveLetter}" />
                        <TextBlock Text="{Binding Path}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>